package com.woniu.thread;

/**
 * @author zhaolei
 * @date 2021/5/7 - 19:23
 */
public class ThreadDemo1 {
    public static void main(String[] args) {
        new firstThread().start();
        new secThread().start();
    }
}

class firstThread extends Thread{
    @Override
    public void run() {
        for (int i = 0; i <100 ; i++) {
            System.out.println(this.getName() + "--第" + (i + 1) + "次执行");
        }
    }
}

class secThread extends Thread{
    @Override
    public void run() {
        for (int i = 0; i <100 ; i++) {
            System.out.println(Thread.currentThread().getName() + "--第" + (i + 1) + "次执行");
        }
    }
}
